home *** CD-ROM | disk | FTP | other *** search
- Path: slip-2-7.ots.utexas.edu!user
- From: ferry299@cs.utexas.edu (Ferry Sutanto)
- Newsgroups: comp.lang.c++
- Subject: struct member
- Date: Fri, 22 Mar 1996 01:04:41 -0600
- Organization: The University of Texas Austin
- Message-ID: <ferry299-2203960104410001@slip-2-7.ots.utexas.edu>
- NNTP-Posting-Host: slip-2-7.ots.utexas.edu
-
- Hi,
-
- I need some help here. :-). If I have an object in a struct as its member,
- can I initialize it with initializer list ? If so, how ? For example,
-
- class A
- {
- public:
- A() { };
- A( int ) { };
- }
-
- struct mystruct{
- A memberA;
- int i
- };
-
- void main( void )
- {
- A a1;
- struct mystruct st = { a1, 1 }; //<======can I do this ?
-
- struct mystruct st2 = { a(1), 1 }; //<=======how about this ?
- };
-
-
- Thank you before hand.
-
- -Ferry
-